<template>
  <div class="index-page">

    <m-tabbar :list='tabList'
              :tab='tab_'></m-tabbar>
  </div>
</template>

<script>
import mTabbar from '@/components/tabbar'
import { mapState, mapActions } from 'vuex'
export default {
  data () {
    return {
      title: '首页',
      searchVal: '',
      list: [
        {
          id: 1,
          name: '非中央空调',
          detail: '家用空调'
        }, {
          id: 2,
          name: '排水系统',
          detail: '水管,水龙头'
        }, {
          id: 10,
          name: '强电系统',
          detail: '家用空调'
        }, {
          id: 3,
          name: '消防系统',
          detail: '消防栓,防火墙'
        }, {
          id: 4,
          name: '弱电系统',
          detail: '监控，门禁，网络'
        }, {
          id: 11,
          name: '建筑类',
          detail: '墙体，天花，地板'
        }, {
          id: 5,
          name: '中央空调',
          detail: '中央空调'
        }, {
          id: 7,
          name: '供溢管道',
          detail: '泵，油管，阀门'
        }, {
          id: 222,
          name: '高温高压',
          detail: '加热器,压缩机 '
        }, {
          id: 6333,
          name: '空压系统',
          detail: '过滤器,空压机 '
        }, {
          id: 4446,
          name: '特殊气体',
          detail: '气罐阀门'
        }, {
          id: 611,
          name: ' 其他 ',
          detail: '未定义类别'
        }
      ]
    }
  },
  methods: {
    getUserInfo () {
      // 调用登录接口
      wx.login({
        success: (res) => {
          console.log(res)
        }
      })
    },
    ...mapActions([
      'urlBack'
    ])
  },
  components: {
    'm-tabbar': mTabbar
  },
  created () {
    this.getUserInfo()
  },
  computed: {
    // tabList () {
    //   return store.state.tabList
    // },
    ...mapState([
      'tabList',
      'tab_'
    ])
  },
  onShow () {
    wx.hideTabBar()
  }
  // onShow () {
  //   console.log('onShow')
  // },
  // mounted () {
  //   console.log('mounted')
  // }
}
</script>

<style lang="scss" scoped>
</style>